import ReplaceMenuProvider from "bpmn-js/lib/features/popup-menu/ReplaceMenuProvider";
import { type PopupMenuTarget } from "diagram-js/lib/features/popup-menu/PopupMenu";
import { type PopupMenuEntries } from "diagram-js/lib/features/popup-menu/PopupMenuProvider";
import { whiteList } from "../whiteList";
export default class CustomReplaceMenuProvider extends ReplaceMenuProvider {
  getPopupMenuEntries(target: PopupMenuTarget): PopupMenuEntries {
    const entries = super.getPopupMenuEntries(target);
    //  console.log(entries);
    Object.keys(entries).forEach((key:string) => {
      if (!whiteList.includes(key) && entries[key]) {
        // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
        delete entries[key];
      }
    });
    return entries;
  }
}